package com.example.calculatorApp.service.impl;

import com.example.calculatorApp.controller.request.resouceRequest;
import com.example.calculatorApp.entity.Resouce;
import com.example.calculatorApp.mapper.ResouceMapper;
import com.example.calculatorApp.service.IResouceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Service
public class resouceIMP implements IResouceService {


    @Autowired
    ResouceMapper resouceMapper;
    @Override
    public List<Resouce> getList(resouceRequest resouceRequest) {
        List<Resouce> list = resouceMapper.getList(resouceRequest);
        System.out.println(list);
        return list;
    }

    @Override
    public void save(Resouce resouce) {
        resouceMapper.save(resouce);
    }

    @Override
    public void deleteById(@PathVariable Integer id){
        resouceMapper.deleteById(id);
    }

    @Override
    public void updateById(Resouce resouce) {
        resouceMapper.updateById(resouce);
    }

    ;
}
